package encrypt

type AESCBC struct {
	Key []byte
}

var (
	empty = ""
)

func (instance AESCBC) Encrypt(input string) (*string, error) {
	intputBytes := []byte(input)
	encrypted, err := EncryptAESByCBC(intputBytes, instance.Key)
	return encrypted, err
}

func (instance AESCBC) Decrypt(input string) (*string, error) {
	if len(input) < 1 {
		return &empty, nil
	}

	intputBytes := []byte(input)
	encrypted, err := DecryptAESByCBC(intputBytes, instance.Key)
	return encrypted, err
}
